package com.yuxi.enums;

/**
*    @author sunke
*    @Date 2023-10-13 10:05:05
*    @description 位置
*/
import com.yuxi.pubInter.EnumVO;
import java.util.ArrayList;
import java.util.List;

public enum BannerPositionFlagEnum {

    INDEX_TOP(1, "首页顶部") ,
    INDEX_BOTTOM(2, "首页底部") ,
    INDEX_ABOUT(9, "首页关于我们") ,
    PRODUCT_LIST(3, "产品列表") ,
    PRODUCT_DETAIL(4, "产品详情") ,
    BRAND_LIST(5, "代理产品列表") ,
    BRAND_DETAIL(6, "代理产品详情") ,
    LINK_US(7, "联系我们") ,
    ABOUT(8, "关于我们") ,
    ADVANTAGE(10, "技术优势") ;




    private Integer type;
    private String desc;

    BannerPositionFlagEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByType(Integer type) {
        if(type==null ){
            type=0;
        }
        for (BannerPositionFlagEnum var : BannerPositionFlagEnum.values()) {
            if (type==var.getType().intValue())
                return var.getDesc();
             }
        return BannerPositionFlagEnum.values()[0].getDesc();
    }

    public static List<EnumVO> getDescs() {
        List list = new ArrayList();

        for (BannerPositionFlagEnum var : BannerPositionFlagEnum.values()) {
            EnumVO enumVO = new EnumVO();
            enumVO.setId(var.getType()+"");
            enumVO.setName(var.getDesc());
            list.add(enumVO);
        }


        return list;
    }

}
